import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
//引入vant
import vant from "vant";
import "vant/lib/index.css";
//引入amfe-flexible
import "amfe-flexible";
//引用axios
import axios from "axios";
axios.defaults.baseURL = import.meta.env.VITE_APP_URL;
//axios拦截器
axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  config.headers.Authorization = `Bearer ${window.sessionStorage.getItem(
    "token"
  )}`;
  return config;
});
//引用router
import router from "./router/router";
//引入 pinia
import { createPinia } from "pinia";
let pinia = createPinia();
const app = createApp(App);
app.use(vant);
app.use(router);
app.use(pinia);
app.mount("#app");
